package com.wzz.controller;

import com.wzz.pojo.BugDetail;
import com.wzz.pojo.vo.BugDetailAndBugProjectVo;
import com.wzz.service.BugDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api")
public class BugDetailController {

    @Autowired
    private BugDetailService bugDetailService;

    @GetMapping("/getAllBugDetailById")
    public List<BugDetailAndBugProjectVo> getAllBugDetailById(Long projectId){
        System.out.println(projectId);
        List<BugDetailAndBugProjectVo> bugDetailAList = bugDetailService.getAllBugDetail(projectId);
        return bugDetailAList;
    }

    @GetMapping("/addBugDetail")
    public int addBugDetail(BugDetail bugDetail){
        return bugDetailService.addBugDetail(bugDetail);
    }


}
